Skip to content

Add vtctld set-shard-tablet-control command#1268

Open
maxenglander wants to merge 2 commits into
mainfrom
maxeng/issues-gh-1753/set-shard-tablet-control
Open

Add vtctld set-shard-tablet-control command#1268
maxenglander wants to merge 2 commits into
mainfrom
maxeng/issues-gh-1753/set-shard-tablet-control

Conversation

@maxenglander

@maxenglander maxenglander commented Jun 6, 2026

Copy link
Copy Markdown
Contributor

Adds a hidden vtctld command to update shard tablet controls on the cluster:

pscale branch vtctld set-shard-tablet-control <database> <branch> \
  --keyspace <keyspace> --shard <shard> --tablet-type rdonly \
  --denied-tables <table>

Requires at least one of --remove, --denied-tables, or --disable-query-service.

Depends on planetscale/planetscale-go#315.

Manual testing

Tested end-to-end against a dev Vitess branch (org with direct_vtctld_access enabled) with the full stack deployed.

  1. Baseline get-shard on unsharded keyspace test-vtctld/- returned empty tablet_controls.
  2. Added denied table:
    pscale branch vtctld set-shard-tablet-control <database> <branch> \
      --keyspace test-vtctld --shard - --tablet-type rdonly --denied-tables customers
    
    returned {}. Re-ran get-shard and confirmed:
    {
      "tablet_controls": [
        {
          "tablet_type": 3,
          "cells": [],
          "denied_tables": ["customers"],
          "frozen": false
        }
      ]
    }
  3. Removed denied table:
    pscale branch vtctld set-shard-tablet-control <database> <branch> \
      --keyspace test-vtctld --shard - --tablet-type rdonly \
      --remove --denied-tables customers
    
    get-shard then showed empty tablet_controls again.
  4. CLI validation: omitting all mutation flags returns must specify at least one of --remove, --denied-tables, or --disable-query-service.
  5. Repeated add/remove on sharded keyspace sharded-2/-80 with --denied-tables orders — same behavior.

Comment thread internal/cmd/branch/vtctld/set_shard_tablet_control.go
@maxenglander maxenglander force-pushed the maxeng/issues-gh-1753/get-shard branch from c523aef to baa7d16 Compare June 7, 2026 04:23
@maxenglander maxenglander force-pushed the maxeng/issues-gh-1753/set-shard-tablet-control branch from 46fc1f8 to 56e07e2 Compare June 7, 2026 04:23
@maxenglander maxenglander force-pushed the maxeng/issues-gh-1753/get-shard branch from baa7d16 to 35ab8e7 Compare June 7, 2026 04:26
@maxenglander maxenglander force-pushed the maxeng/issues-gh-1753/set-shard-tablet-control branch from 56e07e2 to 6f69901 Compare June 7, 2026 04:26

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 27c1ed7. Configure here.

Comment thread internal/cmd/branch/vtctld/set_shard_tablet_control.go
@maxenglander maxenglander force-pushed the maxeng/issues-gh-1753/get-shard branch from 35ab8e7 to d76a790 Compare June 10, 2026 02:13
@maxenglander maxenglander force-pushed the maxeng/issues-gh-1753/set-shard-tablet-control branch from 27c1ed7 to fc3b72f Compare June 10, 2026 02:13
@maxenglander maxenglander force-pushed the maxeng/issues-gh-1753/get-shard branch from 3a7e5c9 to 4c2996a Compare June 12, 2026 03:12
@maxenglander maxenglander force-pushed the maxeng/issues-gh-1753/set-shard-tablet-control branch from f289d20 to e43aab3 Compare June 12, 2026 22:39
Base automatically changed from maxeng/issues-gh-1753/get-shard to main June 12, 2026 22:47
maxenglander and others added 2 commits June 15, 2026 13:44
Co-authored-by: Cursor <cursoragent@cursor.com>
Signed-off-by: Max Englander <max@planetscale.com>
Signed-off-by: Max Englander <max@planetscale.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
@maxenglander maxenglander force-pushed the maxeng/issues-gh-1753/set-shard-tablet-control branch from e43aab3 to a6885b2 Compare June 15, 2026 17:45
@maxenglander maxenglander marked this pull request as ready for review June 15, 2026 18:29
@maxenglander maxenglander requested a review from a team as a code owner June 15, 2026 18:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants